package com.aaa.depression.controller;

import com.aaa.depression.service.DepressionService;
import com.aaa.pojo.Page;
import com.aaa.pojo.ResultBean;
import com.aaa.pojo.question_fpa;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/accountsds")
@ResponseBody
public class DepressionController {
    @Autowired
    private DepressionService depressionService;

    @RequestMapping(value = "/findAllsds"/*, produces = {"application/json;charset=UTF-8"}*/)

    public ResultBean findAll(Page page, question_fpa question) {
        return depressionService.findAll(page,question);
    }
    @RequestMapping("/deletesds")
    public  int delete(Integer id){
        int delete = depressionService.delete(id);
/*        ResultBean resultBean = new ResultBean();
        if (delete){
            resultBean.setCode(0);
            resultBean.setMsg("删除成功");
        }else {
            resultBean.setCode(1);
            resultBean.setMsg("删除成功");
        }*/
        return delete;
    }
    @RequestMapping("/deletessds")
    public int deletes(@RequestParam  Integer[] id){
        return depressionService.deletes(id);
    }
    @RequestMapping("/save")
    public int save(question_fpa question_fpa){
        return depressionService.save(question_fpa);
    }
    @RequestMapping("/update")
    public int update(question_fpa question_fpa){
        return depressionService.update(question_fpa);
    }

}
